from sklearn import datasets
from sklearn.model_selection import cross_val_score
from sklearn.svm import SVC
from tqdm import tqdm

# 加载数据集
digits = datasets.load_digits()

# 定义模型
clf = SVC()

# 使用tqdm包装cross_val_score函数的迭代过程
scores = []
for i in tqdm(range(len(digits.data)), desc="Cross Validation"):
    score = cross_val_score(clf, digits.data, digits.target)
    scores.append(score.mean())

print("Average CV Score:", sum(scores) / len(scores))